home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / gcc / gcc258s.zoo / gcc-258.diff < prev    next >
Encoding:
Text File  |  1994-01-27  |  67.9 KB  |  2,460 lines

  1. diff -rc gcc-2.5.0/c-lex.c /usr1/bammi/sun/usr2/gcc/c-lex.c
  2. *** gcc-2.5.0/c-lex.c    Tue Dec 14 10:45:35 1993
  3. --- /usr1/bammi/sun/usr2/gcc/c-lex.c    Tue Dec 14 10:37:39 1993
  4. ***************
  5. *** 473,484 ****
  6. --- 473,486 ----
  7.       case '\r':
  8.         /* ANSI C says the effects of a carriage return in a source file
  9.            are undefined.  */
  10. + #ifndef atarist /* but not on an atarist, though hopefully we should'nt see it */
  11.         if (pedantic && !newline_warning)
  12.           {
  13.             warning ("carriage return in source file");
  14.             warning ("(we only warn about the first carriage return)");
  15.             newline_warning = 1;
  16.           }
  17. + #endif
  18.         c = getc (finput);
  19.         break;
  20.   
  21. ***************
  22. *** 1438,1444 ****
  23.       if (floatflag != NOT_FLOAT)
  24.         {
  25.           tree type = double_type_node;
  26. !         int garbage_chars = 0, exceeds_double = 0;
  27.           int imag = 0;
  28.           REAL_VALUE_TYPE value;
  29.           jmp_buf handler;
  30. --- 1440,1446 ----
  31.       if (floatflag != NOT_FLOAT)
  32.         {
  33.           tree type = double_type_node;
  34. !         int garbage_chars = 0;
  35.           int imag = 0;
  36.           REAL_VALUE_TYPE value;
  37.           jmp_buf handler;
  38. ***************
  39. *** 1537,1578 ****
  40.   
  41.               type = float_type_node;
  42.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  43. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  44. -             && REAL_VALUE_ISINF (value) && pedantic)
  45. -               pedwarn ("floating point number exceeds range of `float'");
  46.             }
  47.           else if (lflag)
  48.             {
  49.               type = long_double_type_node;
  50.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  51. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  52. -             && REAL_VALUE_ISINF (value) && pedantic)
  53. -               pedwarn ("floating point number exceeds range of `long double'");
  54.             }
  55.           else
  56.             {
  57.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  58. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  59. -             && REAL_VALUE_ISINF (value) && pedantic)
  60. -               pedwarn ("floating point number exceeds range of `double'");
  61.             }
  62.   
  63.           set_float_handler (NULL_PTR);
  64.           }
  65.   #ifdef ERANGE
  66. !         if (errno == ERANGE && !flag_traditional && pedantic)
  67.             {
  68. !           /* ERANGE is also reported for underflow,
  69. !              so test the value to distinguish overflow from that.  */
  70. !         if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  71. !             && (REAL_VALUES_LESS (dconst1, value)
  72. !             || REAL_VALUES_LESS (value, dconstm1)))
  73. !           {
  74. !             pedwarn ("floating point number exceeds range of `double'");
  75. !             exceeds_double = 1;
  76. !           }
  77.             }
  78. - #endif
  79.           garbage_chars = 0;
  80.           while (isalnum (c) || c == '.' || c == '_'
  81.              || (!flag_traditional && (c == '+' || c == '-')
  82. --- 1539,1572 ----
  83.   
  84.               type = float_type_node;
  85.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  86.             }
  87.           else if (lflag)
  88.             {
  89.               type = long_double_type_node;
  90.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  91.             }
  92.           else
  93.             {
  94.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  95.             }
  96.   
  97.           set_float_handler (NULL_PTR);
  98.           }
  99. +         if (pedantic
  100. +         && (REAL_VALUE_ISINF (value)
  101.   #ifdef ERANGE
  102. !             || (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  103. !             && errno == ERANGE
  104. !             /* ERANGE is also reported for underflow, so test the
  105. !                value to distinguish overflow from that.  */
  106. !             && (REAL_VALUES_LESS (dconst1, value)
  107. !                 || REAL_VALUES_LESS (value, dconstm1)))
  108. ! #endif
  109. !             ))
  110.             {
  111. !         pedwarn ("floating point number exceeds range of `%s'",
  112. !              IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
  113.             }
  114.           garbage_chars = 0;
  115.           while (isalnum (c) || c == '.' || c == '_'
  116.              || (!flag_traditional && (c == '+' || c == '-')
  117. diff -rc gcc-2.5.0/calls.c /usr1/bammi/sun/usr2/gcc/calls.c
  118. *** gcc-2.5.0/calls.c    Tue Dec  7 09:35:48 1993
  119. --- /usr1/bammi/sun/usr2/gcc/calls.c    Sun Dec  5 14:22:08 1993
  120. ***************
  121. *** 2107,2112 ****
  122. --- 2107,2118 ----
  123.   
  124.     argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
  125.   
  126. + /* how would you do this RIGHT ?? fake a DECL node? dunno... */
  127. + #ifdef ENCODE_SECTION_INFO
  128. +   /* mark it as a function (to be in the text section that is) */
  129. +   SYMBOL_REF_FLAG (fun) = 1;
  130. + #endif
  131.     INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun);
  132.   
  133.     args_size.constant = 0;
  134. ***************
  135. *** 2403,2408 ****
  136. --- 2409,2419 ----
  137.        library functions shouldn't have many args.  */
  138.   
  139.     argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg));
  140. + #ifdef ENCODE_SECTION_INFO
  141. +   /* mark it as a function (to be in the text section that is) */
  142. +   SYMBOL_REF_FLAG (fun) = 1;
  143. + #endif
  144.   
  145.     INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun);
  146.   
  147. diff -rc gcc-2.5.0/cccp.c /usr1/bammi/sun/usr2/gcc/cccp.c
  148. *** gcc-2.5.0/cccp.c    Tue Dec 14 10:45:37 1993
  149. --- /usr1/bammi/sun/usr2/gcc/cccp.c    Tue Dec 14 10:37:41 1993
  150. ***************
  151. *** 77,82 ****
  152. --- 77,83 ----
  153.   #include <stdio.h>
  154.   #include <signal.h>
  155.   
  156. + #ifndef atarist
  157.   #ifndef VMS
  158.   #ifndef USG
  159.   #include <sys/time.h>        /* for __DATE__ and __TIME__ */
  160. ***************
  161. *** 86,95 ****
  162. --- 87,110 ----
  163.   #include <fcntl.h>
  164.   #endif /* USG */
  165.   #endif /* not VMS */
  166. + #endif /* not atarist */
  167.   
  168.   /* This defines "errno" properly for VMS, and gives us EACCES. */
  169.   #include <errno.h>
  170.   
  171. + /* atarist  specific defs and includes */
  172. + #ifdef atarist
  173. + #include <time.h>
  174. + #include <file.h>
  175. + #include <string.h>
  176. + #include <stddef.h>
  177. + long _stksize = -1L;    /* want big stack cause include files
  178. +                    get alloca'ed there */
  179. + #define read(fd,buf,size)    _text_read(fd,buf,size)
  180. + #endif /* atarist */
  181.   /* VMS-specific definitions */
  182.   #ifdef VMS
  183.   #include <time.h>
  184. ***************
  185. *** 1073,1078 ****
  186. --- 1088,1097 ----
  187.     /* Target-name to write with the dependency information.  */
  188.     char *deps_target = 0;
  189.   
  190. + #ifdef atarist
  191. + #define GCC_INCLUDE_DIR "./"
  192. + #endif  
  193.   #ifdef RLIMIT_STACK
  194.     /* Get rid of any avoidable limit on stack size.  */
  195.     {
  196. ***************
  197. *** 1395,1404 ****
  198. --- 1414,1429 ----
  199.       break;
  200.   
  201.         case 'v':
  202. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  203. + #include "PatchLev.h"
  204. +     fprintf (stderr, "GNU CPP-atariST version %s Patchlevel %s",
  205. +          version_string, PatchLevel);
  206. + #else
  207.       fprintf (stderr, "GNU CPP version %s", version_string);
  208.   #ifdef TARGET_VERSION
  209.       TARGET_VERSION;
  210.   #endif
  211. + #endif
  212.       fprintf (stderr, "\n");
  213.       verbose = 1;
  214.       break;
  215. ***************
  216. *** 1532,1537 ****
  217. --- 1557,1563 ----
  218.       }
  219.     }
  220.   
  221. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  222.     /* Add dirs from CPATH after dirs from -I.  */
  223.     /* There seems to be confusion about what CPATH should do,
  224.        so for the moment it is not documented.  */
  225. ***************
  226. *** 1541,1546 ****
  227. --- 1567,1573 ----
  228.     p = (char *) getenv ("CPATH");
  229.     if (p != 0 && ! no_standard_includes)
  230.       path_include (p);
  231. + #endif
  232.   
  233.     /* Now that dollars_in_ident is known, initialize is_idchar.  */
  234.     initialize_char_syntax ();
  235. ***************
  236. *** 1659,1666 ****
  237.     { /* read the appropriate environment variable and if it exists
  238.          replace include_defaults with the listed path. */
  239.       char *epath = 0;
  240.       switch ((objc << 1) + cplusplus)
  241. !       {
  242.         case 0:
  243.       epath = getenv ("C_INCLUDE_PATH");
  244.       break;
  245. --- 1686,1741 ----
  246.     { /* read the appropriate environment variable and if it exists
  247.          replace include_defaults with the listed path. */
  248.       char *epath = 0;
  249. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  250. +     int db_hack = 0;
  251. +     char *e1 = getenv("GNUINC"), *e2 = getenv("GNULIB"),
  252. +          *e3 = getenv("GXXINC");
  253. +     /* Get length of the alloc'ed array. (Yeah I know, I might alloc
  254. +      * a character more than I need but who cares...
  255. +      */
  256. +     if (cplusplus && e3)
  257. +     db_hack += strlen (e3);
  258. +     if (e1)
  259. +         db_hack += strlen (e1) + 1;
  260. +     if (e2)
  261. +         db_hack += strlen (e1) + 1;
  262. +     if (db_hack) {
  263. +     epath = alloca (db_hack + 1);
  264. +     *epath = '\0';
  265. +     db_hack = 0;
  266. +     /* Concatenate the paths together. */
  267. +     if (cplusplus && e3) {
  268. +         strcpy (epath, e3);
  269. +         db_hack = 1;
  270. +     }
  271. +     if (e1) {
  272. +         if (db_hack) {
  273. +         strcat (epath, PATH_SEP_STR);
  274. +         }
  275. +         strcat (epath, e1);
  276. +         db_hack = 1;
  277. +     }
  278. +     if (e2) {
  279. +         if (db_hack) {
  280. +         strcat (epath, PATH_SEP_STR);
  281. +         }
  282. +         strcat (epath, e2);
  283. +     }
  284. +     }
  285. + #ifdef atarist
  286. +     if (epath)
  287. +         for (e3=epath; *e3; e3++)    /* Use one kind of path separator */
  288. +         if (*e3 == ';')
  289. +         *e3 = PATH_SEPARATOR;
  290. + #endif
  291. + #else
  292.       switch ((objc << 1) + cplusplus)
  293. !     {
  294.         case 0:
  295.       epath = getenv ("C_INCLUDE_PATH");
  296.       break;
  297. ***************
  298. *** 1673,1679 ****
  299.         case 3:
  300.       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
  301.       break;
  302. !       }
  303.       /* If the environment var for this language is set,
  304.          add to the default list of include directories.  */
  305.       if (epath) {
  306. --- 1748,1756 ----
  307.         case 3:
  308.       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
  309.       break;
  310. !     }
  311. ! #endif
  312.       /* If the environment var for this language is set,
  313.          add to the default list of include directories.  */
  314.       if (epath) {
  315. ***************
  316. *** 1727,1739 ****
  317. --- 1804,1826 ----
  318.     if (!no_standard_includes) {
  319.       struct default_include *p = include_defaults;
  320.       char *specd_prefix = include_prefix;
  321. + #ifdef GCC_INCLUDE_DIR
  322.       char *default_prefix = savestring (GCC_INCLUDE_DIR);
  323. + #else
  324. +     char *default_prefix = savestring ("./");
  325. + #endif
  326.       int default_len = 0;
  327.       /* Remove the `include' from /usr/local/lib/gcc.../include.  */
  328.       if (!strcmp (default_prefix + strlen (default_prefix) - 8, "/include")) {
  329.         default_len = strlen (default_prefix) - 7;
  330.         default_prefix[default_len] = 0;
  331.       }
  332. + #ifdef atarist
  333. +     else if (!strcmp (default_prefix + strlen (default_prefix) - 8, "\\include")) {
  334. +       default_len = strlen (default_prefix) - 7;
  335. +       default_prefix[default_len] = 0;
  336. +     }
  337. + #endif
  338.       /* Search "translated" versions of GNU directories.
  339.          These have /usr/local/lib/gcc... replaced by specd_prefix.  */
  340.       if (specd_prefix != 0 && default_len != 0)
  341. ***************
  342. *** 1875,1881 ****
  343. --- 1962,1972 ----
  344.         char *p1 = p;
  345.         /* Discard all directory prefixes from P.  */
  346.         while (*p1) {
  347. + #ifdef atarist
  348. +     if ((*p1 == '/') || (*p1 == '\\'))
  349. + #else
  350.       if (*p1 == '/')
  351. + #endif
  352.         p = p1 + 1;
  353.       p1++;
  354.         }
  355. ***************
  356. *** 2049,2054 ****
  357. --- 2140,2146 ----
  358.     return 0;
  359.   }
  360.   
  361. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  362.   /* Given a colon-separated list of file names PATH,
  363.      add all the names to the search path for include files.  */
  364.   
  365. ***************
  366. *** 2096,2101 ****
  367. --- 2188,2194 ----
  368.         p++;
  369.       }
  370.   }
  371. + #endif /* atarist */
  372.   
  373.   /* Pre-C-Preprocessor to translate ANSI trigraph idiocy in BUF
  374.      before main CCCP processing.  Name `pcp' is also in honor of the
  375. ***************
  376. *** 3282,3287 ****
  377. --- 3375,3381 ----
  378.     assertions_flag = save_assertions_flag;
  379.     return obuf;
  380.   }
  381. + /* #endif */
  382.   
  383.   /*
  384.    * Process a # directive.  Expects IP->bufp to point after the '#', as in
  385. ***************
  386. *** 3981,3987 ****
  387. --- 4075,4086 ----
  388.           dsp[0].next = search_start;
  389.           search_start = dsp;
  390.   #ifndef VMS
  391. + #ifdef atarist
  392. +         if((ep = rindex(nam, '\\')) == NULL)
  393. +         ep = rindex(nam, '/');
  394. + #else
  395.           ep = rindex (nam, '/');
  396. + #endif
  397.   #else                /* VMS */
  398.           ep = rindex (nam, ']');
  399.           if (ep == NULL) ep = rindex (nam, '>');
  400. ***************
  401. *** 4061,4069 ****
  402. --- 4160,4182 ----
  403.   
  404.     /* If specified file name is absolute, just open it.  */
  405.   
  406. + #ifdef atarist
  407. +   if ((*fbeg == '\\') || (*fbeg == '/')) {
  408. +     if(fbeg[2] == ':')
  409. +     { /* allow "\D:\xxx" */
  410. +         strncpy (fname, fbeg+1, flen-1);
  411. +         fname[flen-1] = 0;
  412. +     }
  413. +     else
  414. +     {  /* allow "\lib\xxx" == "\currentdrive:\lib\xxx" */
  415. +         strncpy (fname, fbeg, flen);
  416. +         fname[flen] = 0;
  417. +     }
  418. + #else
  419.     if (*fbeg == '/') {
  420.       strncpy (fname, fbeg, flen);
  421.       fname[flen] = 0;
  422. + #endif
  423.       if (redundant_include_p (fname))
  424.         return 0;
  425.       if (importing)
  426. ***************
  427. *** 4084,4090 ****
  428. --- 4197,4207 ----
  429.       if (searchptr->fname[0] == 0)
  430.         continue;
  431.       strcpy (fname, searchptr->fname);
  432. + #ifdef atarist
  433. +     strcat (fname, "\\");
  434. + #else
  435.       strcat (fname, "/");
  436. + #endif
  437.       fname[strlen (fname) + flen] = 0;
  438.         } else {
  439.       fname[0] = 0;
  440. ***************
  441. *** 4197,4213 ****
  442.   
  443.       if (!no_precomp)
  444.         do {
  445.       sprintf (pcftry, "%s%d", fname, pcfnum++);
  446.       
  447.       pcf = open (pcftry, O_RDONLY, 0666);
  448.       if (pcf != -1)
  449.         {
  450.           struct stat s;
  451.   
  452.           fstat (pcf, &s);
  453.           if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
  454.           || stat_f.st_dev != s.st_dev)
  455. !           {
  456.           pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
  457.           /* Don't need it any more.  */
  458.           close (pcf);
  459. --- 4314,4372 ----
  460.   
  461.       if (!no_precomp)
  462.         do {
  463. + #ifdef atarist
  464. +     int numlen;
  465. +     char *dot;
  466. +     char *slash;
  467. +     /* cut extension to 3 chars and dont depend on UNIXMODE           */
  468. +     /* this will have to be done when saving precompiled headers, too */
  469. +     /* but as far as I tried, they dont work up to now, anyway   (AL) */
  470. +       if( pcfnum>=100 )     numlen=3;
  471. +       else if( pcfnum>=10 ) numlen=2;
  472. +       else                  numlen=1;
  473. +       dot=strrchr( fname, '.' );
  474. +       if( (slash=strrchr( fname, '/')) && slash>dot )
  475. +         dot=NULL;
  476. +       else
  477. +       if( (slash=strrchr( fname, '\\')) && slash>dot )
  478. +         dot=NULL;
  479. +       if( dot ) {
  480. +         if( strlen(dot)-1>3-numlen ) {
  481. +           sprintf(pcftry, "%.*s%d", strlen(fname)-(strlen(dot)-(4-numlen)),
  482. +                   fname, pcfnum++);
  483. +         } else {
  484. +           sprintf(pcftry, "%s%d", fname, pcfnum++);
  485. +         }
  486. +       } else {
  487. +         sprintf( pcftry, "%s.%d", fname, pcfnum++);
  488. +       }
  489. + #else    /* looks like we got a sane filesystem */
  490.       sprintf (pcftry, "%s%d", fname, pcfnum++);
  491. + #endif
  492. + #if 0
  493. +     fprintf ( stderr, "trying precompiled file %s.\n", pcftry );
  494. + #endif
  495.       
  496.       pcf = open (pcftry, O_RDONLY, 0666);
  497.       if (pcf != -1)
  498.         {
  499. + #ifndef atarist
  500. +         /* dont bother with this on the ST since these field are faked
  501. +          * anyways
  502. +              */
  503.           struct stat s;
  504.   
  505.           fstat (pcf, &s);
  506.           if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
  507.           || stat_f.st_dev != s.st_dev)
  508. ! #else
  509. !         if (1)
  510. ! #endif
  511. !               {
  512.           pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
  513.           /* Don't need it any more.  */
  514.           close (pcf);
  515. ***************
  516. *** 6210,6216 ****
  517.     free (trybuf.buf);
  518.   
  519.     /* Output directive name.  */
  520. !   check_expand (op, 8);
  521.     bcopy ("#ident ", op->bufp, 7);
  522.     op->bufp += 7;
  523.   
  524. --- 6369,6375 ----
  525.     free (trybuf.buf);
  526.   
  527.     /* Output directive name.  */
  528. !   check_expand (op, 7);
  529.     bcopy ("#ident ", op->bufp, 7);
  530.     op->bufp += 7;
  531.   
  532. ***************
  533. *** 8956,8961 ****
  534. --- 9115,9121 ----
  535.     deps_buffer[deps_size] = 0;
  536.   }
  537.   
  538. + #if (!(defined(atarist) || defined(atariminix)))
  539.   #if defined(USG) || defined(VMS)
  540.   #ifndef BSTRING
  541.   
  542. ***************
  543. *** 8992,8998 ****
  544.   }
  545.   #endif /* not BSTRING */
  546.   #endif /* USG or VMS */
  547.   
  548.   static void
  549.   fatal (str, arg)
  550. --- 9152,9158 ----
  551.   }
  552.   #endif /* not BSTRING */
  553.   #endif /* USG or VMS */
  554. ! #endif /* any atari */
  555.   
  556.   static void
  557.   fatal (str, arg)
  558. diff -rc gcc-2.5.0/config/m68k/m68k.c /usr1/bammi/sun/usr2/gcc/config/m68k/m68k.c
  559. *** gcc-2.5.0/config/m68k/m68k.c    Mon Nov 15 11:07:54 1993
  560. --- /usr1/bammi/sun/usr2/gcc/config/m68k/m68k.c    Mon Nov 15 14:48:56 1993
  561. ***************
  562. *** 61,67 ****
  563.   void
  564.   finalize_pic ()
  565.   {
  566. !   if (flag_pic && current_function_uses_pic_offset_table)
  567.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  568.   }
  569.   
  570. --- 61,67 ----
  571.   void
  572.   finalize_pic ()
  573.   {
  574. !   if (flag_pic && flag_pic < 3 && current_function_uses_pic_offset_table)
  575.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  576.   }
  577.   
  578. ***************
  579. *** 214,220 ****
  580.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  581.   #endif
  582.       }
  583. !   if (flag_pic && current_function_uses_pic_offset_table)
  584.       {
  585.   #ifdef MOTOROLA
  586.         asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
  587. --- 214,220 ----
  588.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  589.   #endif
  590.       }
  591. !   if (flag_pic && flag_pic < 3 && current_function_uses_pic_offset_table)
  592.       {
  593.   #ifdef MOTOROLA
  594.         asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
  595. ***************
  596. *** 801,812 ****
  597.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  598.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  599.       {
  600.         if (reg == 0)
  601.       abort ();
  602.   
  603. !       pic_ref = gen_rtx (MEM, Pmode,
  604. !              gen_rtx (PLUS, Pmode,
  605. !                   pic_offset_table_rtx, orig));
  606.         current_function_uses_pic_offset_table = 1;
  607.         RTX_UNCHANGING_P (pic_ref) = 1;
  608.         emit_move_insn (reg, pic_ref);
  609. --- 801,820 ----
  610.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  611.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  612.       {
  613. + #ifdef LEGITIMATE_BASEREL_OPERAND_P
  614. +       if (LEGITIMATE_BASEREL_OPERAND_P (orig))
  615. +     return orig;
  616. + #endif
  617.         if (reg == 0)
  618.       abort ();
  619.   
  620. !       if (flag_pic == 3)
  621. !         pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
  622. !       else
  623. !         pic_ref = gen_rtx (MEM, Pmode,
  624. !                gen_rtx (PLUS, Pmode,
  625. !                     pic_offset_table_rtx, orig));
  626.         current_function_uses_pic_offset_table = 1;
  627.         RTX_UNCHANGING_P (pic_ref) = 1;
  628.         emit_move_insn (reg, pic_ref);
  629. ***************
  630. *** 1859,1864 ****
  631. --- 1867,1875 ----
  632.         output_address (XEXP (op, 0));
  633.         if (letter == 'd' && ! TARGET_68020
  634.         && CONSTANT_ADDRESS_P (XEXP (op, 0))
  635. +       && !(TARGET_PC_REL && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
  636. +            && SYMBOL_REF_FLAG (XEXP (op, 0))
  637. +            && !SYMBOL_REF_USED (XEXP (op, 0)))
  638.         && !(GET_CODE (XEXP (op, 0)) == CONST_INT
  639.              && INTVAL (XEXP (op, 0)) < 0x8000
  640.              && INTVAL (XEXP (op, 0)) >= -0x8000))
  641. ***************
  642. *** 2166,2171 ****
  643. --- 2177,2184 ----
  644.                 fprintf (file, ":w");
  645.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  646.                 fprintf (file, ":l");
  647. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  648. +               fprintf (file, ":w");
  649.             }
  650.           if (addr != 0 && ireg != 0)
  651.             {
  652. ***************
  653. *** 2243,2248 ****
  654. --- 2256,2273 ----
  655.           fprintf (file, "%d:w", INTVAL (addr));
  656.   #endif
  657.         }
  658. +     else if (TARGET_PC_REL && GET_CODE (addr) == SYMBOL_REF
  659. +          && SYMBOL_REF_FLAG (addr) && !SYMBOL_REF_USED (addr))
  660. +       {
  661. + #ifdef MOTOROLA
  662. +         output_addr_const (file, addr);
  663. +         fputs ("(pc)", file);
  664. + #else
  665. +         fputs ("pc@(", file);
  666. +         output_addr_const (file, addr);
  667. +         putc (')', file);
  668. + #endif
  669. +       }
  670.       else
  671.         {
  672.           output_addr_const (file, addr);
  673. ***************
  674. *** 2309,2311 ****
  675. --- 2334,2352 ----
  676.   
  677.     return 0;
  678.   }
  679. + #ifdef ENCODE_SECTION_INFO
  680. + /* Does operand (which is a symbolic_operand) live in text space? If
  681. +    so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.*/
  682. + int
  683. + read_only_operand (operand)
  684. +      rtx operand;
  685. + {
  686. +   if (GET_CODE (operand) == CONST)
  687. +     operand = XEXP (XEXP (operand, 0), 0);
  688. +   if (GET_CODE (operand) == SYMBOL_REF)
  689. +     return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
  690. +   return 1;
  691. + }
  692. + #endif
  693. diff -rc gcc-2.5.0/config/m68k/m68k.h /usr1/bammi/sun/usr2/gcc/config/m68k/m68k.h
  694. *** gcc-2.5.0/config/m68k/m68k.h    Mon Nov 15 11:07:54 1993
  695. --- /usr1/bammi/sun/usr2/gcc/config/m68k/m68k.h    Mon Nov 15 14:48:57 1993
  696. ***************
  697. *** 92,97 ****
  698. --- 92,103 ----
  699.   /* Use the 68040-only fp instructions (-m68040).  */
  700.   #define TARGET_68040_ONLY (target_flags & 01000)
  701.   
  702. + /* Use PC-relative addressing for refs to read-only data */
  703. + #define TARGET_PC_REL (target_flags & 02000)
  704. + /* Use base-relative addressing for refs to data&bss segments */
  705. + #define TARGET_BASE_REL (target_flags & 04000)
  706.   /* Macro to define tables used to set the flags.
  707.      This is a list in braces of pairs in braces,
  708.      each pair being { "NAME", VALUE }
  709. ***************
  710. *** 121,126 ****
  711. --- 127,136 ----
  712.       { "68030", -01400},                \
  713.       { "68030", 5},                \
  714.       { "68040", 01007},                \
  715. +     { "pcrel", 02000},                \
  716. +     { "nopcrel", -02000},            \
  717. +     { "baserel", 04000},            \
  718. +     { "nobaserel", -04000},            \
  719.       { "68851", 0},    /* Affects *_SPEC and/or GAS.  */    \
  720.       { "no-68851", 0},    /* Affects *_SPEC and/or GAS.  */    \
  721.       { "68302", 0},    /* Affects *_SPEC and/or GAS.  */    \
  722. ***************
  723. *** 143,154 ****
  724. --- 153,166 ----
  725.     if (! TARGET_68020 && flag_pic == 2)    \
  726.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  727.     SUBTARGET_OVERRIDE_OPTIONS        \
  728. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  729.   }
  730.   #else
  731.   #define OVERRIDE_OPTIONS        \
  732.   {                    \
  733.     if (! TARGET_68020 && flag_pic == 2)    \
  734.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  735. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  736.     SUBTARGET_OVERRIDE_OPTIONS        \
  737.   }
  738.   #endif /* defined SUPPORT_SUN_FPA */
  739. ***************
  740. *** 356,361 ****
  741. --- 368,376 ----
  742.   {                                               \
  743.     if (flag_pic)                                 \
  744.       fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  745. +   /* prevent saving/restoring of the base reg */ \
  746. +   if (flag_pic == 3)                 \
  747. +     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  748.   }
  749.   
  750.   #else /* defined SUPPORT_SUN_FPA */
  751. ***************
  752. *** 380,385 ****
  753. --- 395,403 ----
  754.       }                         \
  755.     if (flag_pic)                                 \
  756.       fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  757. +   /* prevent saving/restoring of the base reg */ \
  758. +   if (flag_pic == 3)                 \
  759. +     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  760.   }
  761.   
  762.   #endif /* defined SUPPORT_SUN_FPA */
  763. ***************
  764. *** 1155,1160 ****
  765. --- 1173,1180 ----
  766.          && GET_CODE (XEXP (X, 1)) == CONST_INT                \
  767.          && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000)        \
  768.      || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  769. +        && flag_pic == 3 && CONSTANT_ADDRESS_P (XEXP (X, 1)))        \
  770. +    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  771.          && flag_pic && GET_CODE (XEXP (X, 1)) == SYMBOL_REF)        \
  772.      || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  773.          && flag_pic && GET_CODE (XEXP (X, 1)) == LABEL_REF))        \
  774. ***************
  775. *** 1221,1227 ****
  776.   #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
  777.   { GO_IF_NONINDEXED_ADDRESS (X, ADDR);                    \
  778.     GO_IF_INDEXED_ADDRESS (X, ADDR);                    \
  779. !   if (flag_pic && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS    \
  780.         && LEGITIMATE_INDEX_P (XEXP (X, 0))                \
  781.         && GET_CODE (XEXP (X, 1)) == LABEL_REF)                \
  782.       goto ADDR; }
  783. --- 1241,1247 ----
  784.   #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
  785.   { GO_IF_NONINDEXED_ADDRESS (X, ADDR);                    \
  786.     GO_IF_INDEXED_ADDRESS (X, ADDR);                    \
  787. !   if ((flag_pic && flag_pic < 3) && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS    \
  788.         && LEGITIMATE_INDEX_P (XEXP (X, 0))                \
  789.         && GET_CODE (XEXP (X, 1)) == LABEL_REF)                \
  790.       goto ADDR; }
  791. diff -rc gcc-2.5.0/config/m68k/m68k.md /usr1/bammi/sun/usr2/gcc/config/m68k/m68k.md
  792. *** gcc-2.5.0/config/m68k/m68k.md    Tue Dec  7 09:35:51 1993
  793. --- /usr1/bammi/sun/usr2/gcc/config/m68k/m68k.md    Sun Dec  5 14:22:11 1993
  794. ***************
  795. *** 716,728 ****
  796.   {
  797.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  798.       {
  799. !       /* The source is an address which requires PIC relocation.  
  800. !          Call legitimize_pic_address with the source, mode, and a relocation
  801. !          register (a new pseudo, or the final destination if reload_in_progress
  802. !          is set).   Then fall through normally */
  803. !       extern rtx legitimize_pic_address();
  804. !       rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  805. !       operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  806.       }
  807.   }")
  808.   
  809. --- 716,733 ----
  810.   {
  811.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  812.       {
  813. ! #ifdef LEGITIMATE_BASEREL_OPERAND_P
  814. !       if (flag_pic != 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
  815. ! #endif
  816. !       {
  817. !         /* The source is an address which requires PIC relocation.  
  818. !            Call legitimize_pic_address with the source, mode, and a relocation
  819. !            register (a new pseudo, or the final destination if reload_in_progress
  820. !            is set).   Then fall through normally */
  821. !         extern rtx legitimize_pic_address();
  822. !         rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  823. !         operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  824. !       }
  825.       }
  826.   }")
  827.   
  828. ***************
  829. *** 4858,4864 ****
  830.     ""
  831.     "
  832.   {
  833. !   if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  834.   #ifdef MOTOROLA
  835.       SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  836.   #else
  837. --- 4863,4869 ----
  838.     ""
  839.     "
  840.   {
  841. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  842.   #ifdef MOTOROLA
  843.       SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  844.   #else
  845. ***************
  846. *** 4873,4879 ****
  847.        (match_operand:SI 1 "general_operand" "g"))]
  848.     ;; Operand 1 not really used on the m68000.
  849.   
  850. !   "! flag_pic"
  851.     "*
  852.   #ifdef MOTOROLA
  853.     return \"jsr %0\";
  854. --- 4878,4884 ----
  855.        (match_operand:SI 1 "general_operand" "g"))]
  856.     ;; Operand 1 not really used on the m68000.
  857.   
  858. !   "(! flag_pic || flag_pic == 3)"
  859.     "*
  860.   #ifdef MOTOROLA
  861.     return \"jsr %0\";
  862. ***************
  863. *** 4888,4894 ****
  864.        (match_operand:SI 1 "general_operand" "g"))]
  865.     ;; Operand 1 not really used on the m68000.
  866.   
  867. !   "flag_pic"
  868.     "*
  869.   #ifdef HPUX_ASM
  870.     return \"bsr %0\";
  871. --- 4893,4899 ----
  872.        (match_operand:SI 1 "general_operand" "g"))]
  873.     ;; Operand 1 not really used on the m68000.
  874.   
  875. !   "(flag_pic && flag_pic < 3)"
  876.     "*
  877.   #ifdef HPUX_ASM
  878.     return \"bsr %0\";
  879. ***************
  880. *** 4913,4919 ****
  881.     ""
  882.     "
  883.   {
  884. !   if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  885.   #ifdef MOTOROLA
  886.       SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  887.   #else
  888. --- 4918,4924 ----
  889.     ""
  890.     "
  891.   {
  892. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  893.   #ifdef MOTOROLA
  894.       SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  895.   #else
  896. ***************
  897. *** 4928,4934 ****
  898.       (call (match_operand:QI 1 "memory_operand" "o")
  899.             (match_operand:SI 2 "general_operand" "g")))]
  900.     ;; Operand 2 not really used on the m68000.
  901. !   "! flag_pic"
  902.     "*
  903.   #ifdef MOTOROLA
  904.     return \"jsr %1\";
  905. --- 4933,4939 ----
  906.       (call (match_operand:QI 1 "memory_operand" "o")
  907.             (match_operand:SI 2 "general_operand" "g")))]
  908.     ;; Operand 2 not really used on the m68000.
  909. !   "(! flag_pic || flag_pic == 3)"
  910.     "*
  911.   #ifdef MOTOROLA
  912.     return \"jsr %1\";
  913. ***************
  914. *** 4943,4949 ****
  915.       (call (match_operand:QI 1 "memory_operand" "o")
  916.             (match_operand:SI 2 "general_operand" "g")))]
  917.     ;; Operand 2 not really used on the m68000.
  918. !   "flag_pic"
  919.     "*
  920.   #ifdef HPUX_ASM
  921.     return \"bsr %1\";
  922. --- 4948,4954 ----
  923.       (call (match_operand:QI 1 "memory_operand" "o")
  924.             (match_operand:SI 2 "general_operand" "g")))]
  925.     ;; Operand 2 not really used on the m68000.
  926. !   "(flag_pic && flag_pic < 3)"
  927.     "*
  928.   #ifdef HPUX_ASM
  929.     return \"bsr %1\";
  930. *** gcc-2.5.0/cp-cvt.c    Sun Nov 28 21:58:19 1993
  931. --- /usr1/bammi/sun/usr2/gcc/cp-cvt.c    Sun Nov 28 21:51:30 1993
  932. ***************
  933. *** 264,269 ****
  934. --- 264,272 ----
  935.       return error_mark_node;
  936.         if (binfo == NULL_TREE)
  937.       return error_not_base_type (target_type, argtype);
  938. +       if (binfo == 0) {
  939. +         return error_mark_node;
  940. +       } else
  941.         basetype = BINFO_TYPE (binfo);
  942.       }
  943.   
  944. diff -rc gcc-2.5.0/cp-lex.c /usr1/bammi/sun/usr2/gcc/cp-lex.c
  945. *** gcc-2.5.0/cp-lex.c    Sun Nov 28 21:58:25 1993
  946. --- /usr1/bammi/sun/usr2/gcc/cp-lex.c    Sun Nov 28 21:51:42 1993
  947. ***************
  948. *** 3473,3479 ****
  949.           tree type = double_type_node;
  950.           char f_seen = 0;
  951.           char l_seen = 0;
  952. !         int garbage_chars = 0, exceeds_double = 0;
  953.           REAL_VALUE_TYPE value;
  954.           jmp_buf handler;
  955.   
  956. --- 3473,3479 ----
  957.           tree type = double_type_node;
  958.           char f_seen = 0;
  959.           char l_seen = 0;
  960. !         int garbage_chars = 0;
  961.           REAL_VALUE_TYPE value;
  962.           jmp_buf handler;
  963.   
  964. ***************
  965. *** 3523,3581 ****
  966.             case 'f': case 'F':
  967.               type = float_type_node;
  968.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  969. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  970. -             && REAL_VALUE_ISINF (value) && pedantic)
  971. -               pedwarn ("floating point number exceeds range of `float'");
  972.               garbage_chars = -1;
  973.               break;
  974.   
  975.             case 'l': case 'L':
  976.               type = long_double_type_node;
  977.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  978. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  979. -             && REAL_VALUE_ISINF (value) && pedantic)
  980. -               pedwarn (
  981. -                    "floating point number exceeds range of `long double'");
  982.               garbage_chars = -1;
  983.               break;
  984.   
  985.             default:
  986.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  987. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  988. -             && REAL_VALUE_ISINF (value) && pedantic)
  989. -               pedwarn ("floating point number exceeds range of `double'");
  990.             }
  991. !         set_float_handler (NULL);
  992.             }
  993.   #ifdef ERANGE
  994. !         if (errno == ERANGE && !flag_traditional && pedantic)
  995.             {
  996. !         char *p1 = token_buffer;
  997. !         /* Check for "0.0" and variants;
  998. !            SunOS 4 spuriously returns ERANGE for them.  */
  999. !         while (*p1 == '0') p1++;
  1000. !         if (*p1 == '.')
  1001. !             {
  1002. !             p1++;
  1003. !             while (*p1 == '0') p1++;
  1004. !             }
  1005. !         if (*p1 == 'e' || *p1 == 'E')
  1006. !           {
  1007. !             /* with significand==0, ignore the exponent */
  1008. !             p1++;
  1009. !             while (*p1 != 0) p1++;
  1010. !           }
  1011. !           /* ERANGE is also reported for underflow,
  1012. !              so test the value to distinguish overflow from that.  */
  1013. !         if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  1014. !             && (REAL_VALUES_LESS (dconst1, value)
  1015. !             || REAL_VALUES_LESS (value, dconstm1)))
  1016. !           {
  1017. !             pedwarn ("floating point number exceeds range of `double'");
  1018. !             exceeds_double = 1;
  1019. !           }
  1020.             }
  1021. - #endif
  1022.           /* Note: garbage_chars is -1 if first char is *not* garbage.  */
  1023.           while (isalnum (c))
  1024.             {
  1025. --- 3523,3557 ----
  1026.             case 'f': case 'F':
  1027.               type = float_type_node;
  1028.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  1029.               garbage_chars = -1;
  1030.               break;
  1031.   
  1032.             case 'l': case 'L':
  1033.               type = long_double_type_node;
  1034.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  1035.               garbage_chars = -1;
  1036.               break;
  1037.   
  1038.             default:
  1039.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  1040.             }
  1041. !         set_float_handler (NULL_PTR);
  1042.             }
  1043. +         if (pedantic
  1044. +         && (REAL_VALUE_ISINF (value)
  1045.   #ifdef ERANGE
  1046. !             || (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  1047. !             && errno == ERANGE
  1048. !             /* ERANGE is also reported for underflow, so test the
  1049. !                value to distinguish overflow from that.  */
  1050. !             && (REAL_VALUES_LESS (dconst1, value)
  1051. !                 || REAL_VALUES_LESS (value, dconstm1)))
  1052. ! #endif
  1053. !             ))
  1054.             {
  1055. !         pedwarn ("floating point number exceeds range of `%s'",
  1056. !              IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
  1057.             }
  1058.           /* Note: garbage_chars is -1 if first char is *not* garbage.  */
  1059.           while (isalnum (c))
  1060.             {
  1061. diff -rc gcc-2.5.0/cp-parse.y /usr1/bammi/sun/usr2/gcc/cp-parse.y
  1062. *** gcc-2.5.0/cp-parse.y    Sun Nov 28 21:58:27 1993
  1063. --- /usr1/bammi/sun/usr2/gcc/cp-parse.y    Sun Nov 28 21:58:36 1993
  1064. ***************
  1065. *** 1127,1134 ****
  1066.             else if (TREE_CODE ($2) == TREE_LIST)
  1067.                   {
  1068.                 tree t = TREE_VALUE ($2);
  1069. !               if (t != NULL_TREE
  1070. !               && TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
  1071.               pedwarn ("ANSI C++ forbids using sizeof() on a function");
  1072.               }
  1073.             $$ = c_sizeof (TREE_TYPE ($2)); }
  1074. --- 1127,1134 ----
  1075.             else if (TREE_CODE ($2) == TREE_LIST)
  1076.                   {
  1077.                 tree t = TREE_VALUE ($2);
  1078. !               if (t != NULL_TREE && 
  1079. !                   ((TREE_TYPE( t) == 0) || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE))
  1080.               pedwarn ("ANSI C++ forbids using sizeof() on a function");
  1081.               }
  1082.             $$ = c_sizeof (TREE_TYPE ($2)); }
  1083. ***************
  1084. *** 1919,1924 ****
  1085. --- 1919,1935 ----
  1086.           warning ("`%s' attribute directive ignored",
  1087.                IDENTIFIER_POINTER ($1));
  1088.         $$ = $1; }
  1089. +     | TYPE_QUAL
  1090. +     | IDENTIFIER '(' IDENTIFIER ')'
  1091. +     { /* If not "mode (m)", then issue warning.  */
  1092. +       if (strcmp (IDENTIFIER_POINTER ($1), "mode") != 0)
  1093. +         {
  1094. +           warning ("`%s' attribute directive ignored",
  1095. +                IDENTIFIER_POINTER ($1));
  1096. +           $$ = $1;
  1097. +         }
  1098. +       else
  1099. +         $$ = tree_cons ($1, $3, NULL_TREE); }
  1100.       | IDENTIFIER '(' CONSTANT ')'
  1101.       { /* if not "aligned(n)", then issue warning */
  1102.         if (strcmp (IDENTIFIER_POINTER ($1), "aligned") != 0
  1103. *** gcc-2.5.0/cp-tree.c    Tue Dec  7 09:36:02 1993
  1104. --- /usr1/bammi/sun/usr2/gcc/cp-tree.c    Sun Dec  5 14:22:21 1993
  1105. ***************
  1106. *** 1676,1681 ****
  1107. --- 1676,1682 ----
  1108.     print_class_statistics ();
  1109.   }
  1110.   
  1111. + #ifndef atarist
  1112.   /* This is used by the `assert' macro.  It is provided in libgcc.a,
  1113.      which `cc' doesn't know how to link.  Note that the C++ front-end
  1114.      no longer actually uses the `assert' macro (instead, it calls
  1115. ***************
  1116. *** 1698,1703 ****
  1117. --- 1699,1705 ----
  1118.     fflush (stderr);
  1119.     abort ();
  1120.   }
  1121. + #endif
  1122.   
  1123.   /* Return, as an INTEGER_CST node, the number of elements for
  1124.      TYPE (which is an ARRAY_TYPE).  This counts only elements of the top array. */
  1125. diff -rc gcc-2.5.0/dbxout.c /usr1/bammi/sun/usr2/gcc/dbxout.c
  1126. *** gcc-2.5.0/dbxout.c    Tue Dec 14 10:45:45 1993
  1127. --- /usr1/bammi/sun/usr2/gcc/dbxout.c    Tue Dec 14 10:37:54 1993
  1128. ***************
  1129. *** 471,476 ****
  1130. --- 471,482 ----
  1131.        and output them all, except for those already output.  */
  1132.   
  1133.     dbxout_typedefs (syms);
  1134. +   /* Make sure that gdb extensions, if desired, are used immediately for C++. */
  1135. +   if (use_gnu_debug_info_extensions
  1136. +       && strcmp (lang_identify (), "cplusplus") == 0)
  1137. +     have_used_extensions = 1;
  1138.   }
  1139.   
  1140.   /* Output any typedef names for types described by TYPE_DECLs in SYMS,
  1141. *** gcc-2.5.0/gcc.c    Thu Jan 27 15:20:31 1994
  1142. --- /usr1/bammi/sun/usr2/gcc/gcc.c    Thu Jan 27 15:21:52 1994
  1143. ***************
  1144. *** 30,35 ****
  1145. --- 30,44 ----
  1146.   Once it knows which kind of compilation to perform, the procedure for
  1147.   compilation is specified by a string called a "spec".  */
  1148.   
  1149. + #ifdef CROSSATARI
  1150. + #ifdef atarist
  1151. + #undef atarist
  1152. + #endif
  1153. + #ifdef atariminix
  1154. + #undef atariminix
  1155. + #endif
  1156. + #endif
  1157. +   
  1158.   #include <sys/types.h>
  1159.   #include <ctype.h>
  1160.   #include <signal.h>
  1161. ***************
  1162. *** 40,45 ****
  1163. --- 49,56 ----
  1164.   #include "obstack.h"
  1165.   #include "gvarargs.h"
  1166.   #include <stdio.h>
  1167. + #include <string.h>
  1168. +     /* if your supplier still does'nt have string.h, shoot him.. */
  1169.   
  1170.   #ifndef R_OK
  1171.   #define R_OK 4
  1172. ***************
  1173. *** 65,71 ****
  1174.   #define NULL_PTR ((GENERIC_PTR)0)
  1175.   #endif
  1176.   
  1177. ! #ifdef USG
  1178.   #define vfork fork
  1179.   #endif /* USG */
  1180.   
  1181. --- 76,82 ----
  1182.   #define NULL_PTR ((GENERIC_PTR)0)
  1183.   #endif
  1184.   
  1185. ! #if (defined(USG) || defined(atariminix))
  1186.   #define vfork fork
  1187.   #endif /* USG */
  1188.   
  1189. ***************
  1190. *** 97,102 ****
  1191. --- 108,124 ----
  1192.   #define PATH_SEPARATOR ':'
  1193.   #endif
  1194.   
  1195. + #ifdef CROSSATARI
  1196. + #include <ctype.h>
  1197. + #endif
  1198. + #ifdef atarist
  1199. + #include <osbind.h>
  1200. + #include <ctype.h>
  1201. + #include <fcntl.h>        /* fgth, for redirection of stderr */
  1202. + long _stksize = 8192;
  1203. + #endif
  1204.   #define obstack_chunk_alloc xmalloc
  1205.   #define obstack_chunk_free free
  1206.   
  1207. ***************
  1208. *** 161,167 ****
  1209. --- 183,191 ----
  1210.      pass the compiler in building the list of pointers to constructors
  1211.      and destructors.  */
  1212.   
  1213. + #if (!(defined(CROSSATARI) || defined(atarist)))
  1214.   static struct obstack collect_obstack;
  1215. + #endif
  1216.   
  1217.   extern char *version_string;
  1218.   
  1219. ***************
  1220. *** 462,468 ****
  1221.              %{aux-info*}\
  1222.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1223.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1224. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1225.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1226.                         %{!pipe:%g.s} %A\n }}}}"},
  1227.     {"-",
  1228. --- 486,492 ----
  1229.              %{aux-info*}\
  1230.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1231.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1232. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1233.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1234.                         %{!pipe:%g.s} %A\n }}}}"},
  1235.     {"-",
  1236. ***************
  1237. *** 497,503 ****
  1238.              %{aux-info*}\
  1239.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1240.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1241. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1242.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1243.                         %{!pipe:%g.s} %A\n }}}}"},
  1244.     {".h", "@c-header"},
  1245. --- 521,527 ----
  1246.              %{aux-info*}\
  1247.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1248.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1249. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1250.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1251.                         %{!pipe:%g.s} %A\n }}}}"},
  1252.     {".h", "@c-header"},
  1253. ***************
  1254. *** 533,539 ****
  1255.              %{aux-info*}\
  1256.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1257.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1258. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1259.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1260.                         %{!pipe:%g.s} %A\n }}}}"},
  1261.     {".i", "@cpp-output"},
  1262. --- 557,563 ----
  1263.              %{aux-info*}\
  1264.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1265.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1266. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1267.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1268.                         %{!pipe:%g.s} %A\n }}}}"},
  1269.     {".i", "@cpp-output"},
  1270. ***************
  1271. *** 544,550 ****
  1272.       %{aux-info*}\
  1273.       %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1274.       %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1275. !     %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1276.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
  1277.     {".ii", "@c++-cpp-output"},
  1278.     {"@c++-cpp-output",
  1279. --- 568,574 ----
  1280.       %{aux-info*}\
  1281.       %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1282.       %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1283. !     %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1284.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
  1285.     {".ii", "@c++-cpp-output"},
  1286.     {"@c++-cpp-output",
  1287. ***************
  1288. *** 554,567 ****
  1289.           %{aux-info*}\
  1290.           %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1291.           %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1292. !        %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1293.              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1294.              %{!pipe:%g.s} %A\n }"},
  1295.     {".s", "@assembler"},
  1296.     {"@assembler",
  1297. !    "%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1298.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %i %A\n }"},
  1299.     {".S", "@assembler-with-cpp"},
  1300.     {"@assembler-with-cpp",
  1301.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  1302.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  1303. --- 578,594 ----
  1304.           %{aux-info*}\
  1305.           %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1306.           %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1307. !        %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1308.              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1309.              %{!pipe:%g.s} %A\n }"},
  1310.     {".s", "@assembler"},
  1311.     {"@assembler",
  1312. !    "%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1313.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %i %A\n }"},
  1314.     {".S", "@assembler-with-cpp"},
  1315. +   {".ss", "@assembler-with-cpp"},
  1316. +   {".cpp", "@assembler-with-cpp"},
  1317. +   {".spp", "@assembler-with-cpp"},
  1318.     {"@assembler-with-cpp",
  1319.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  1320.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  1321. ***************
  1322. *** 571,577 ****
  1323.           %{traditional-cpp:-traditional}\
  1324.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
  1325.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
  1326. !    "%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1327.                       %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1328.               %{!pipe:%g.s} %A\n }}}}"},
  1329.     {".ads", "@ada"},
  1330. --- 598,604 ----
  1331.           %{traditional-cpp:-traditional}\
  1332.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
  1333.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
  1334. !    "%{!M:%{!MM:%{!E:%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1335.                       %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1336.               %{!pipe:%g.s} %A\n }}}}"},
  1337.     {".ads", "@ada"},
  1338. ***************
  1339. *** 597,602 ****
  1340. --- 624,638 ----
  1341.   
  1342.   /* Here is the spec for running the linker, after compiling all files.  */
  1343.   
  1344. + #if (defined(CROSSATARI) || defined(atarist) || defined(atariminix))
  1345. + static char *link_command_spec = 
  1346. +  "%{!fsyntax-only: \
  1347. +     %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{v} %{G} %{o*} \
  1348. +       %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z}\
  1349. +       %{!A:%{!nostartfiles:%{!nostdlib:%S}}} %{static:}\
  1350. +       %{L*} %{T*} %o %{!nostdlib:%L}\n }}}}}}";
  1351. + #else
  1352.   /* -u* was put back because both BSD and SysV seem to support it.  */
  1353.   /* %{static:} simply prevents an error message if the target machine
  1354.      doesn't handle -static.  */
  1355. ***************
  1356. *** 630,635 ****
  1357. --- 666,672 ----
  1358.               %{L*} %D %{T*} %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}}";
  1359.   #endif
  1360.   #endif
  1361. + #endif
  1362.   
  1363.   /* A vector of options to give to the linker.
  1364.      These options are accumulated by -Xlinker and -Wl,
  1365. ***************
  1366. *** 857,862 ****
  1367. --- 894,900 ----
  1368.     *argcp = newindex;
  1369.   }
  1370.   
  1371. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  1372.   /* Read compilation specs from a file named FILENAME,
  1373.      replacing the default ones.
  1374.   
  1375. ***************
  1376. *** 996,1001 ****
  1377. --- 1034,1040 ----
  1378.   
  1379.     return p;
  1380.   }
  1381. + #endif /* ataris */
  1382.   
  1383.   /* Structure to keep track of the specs that have been defined so far.  These
  1384.      are accessed using %(specname) or %[specname] in a compiler or link spec. */
  1385. ***************
  1386. *** 1112,1117 ****
  1387. --- 1151,1163 ----
  1388.   /* Name with which this program was invoked.  */
  1389.   
  1390.   static char *programname;
  1391. + #ifdef atarist
  1392. + /* Flag indicating, that stderr should be redirected for the child
  1393. +    processes */
  1394. + unsigned char zflag;
  1395. + #endif
  1396.   
  1397.   /* Structures to keep track of prefixes to try when looking for files. */
  1398.   
  1399. ***************
  1400. *** 1405,1414 ****
  1401.     if (base == (char *)0)
  1402.       base = "./";
  1403.   
  1404.     len = strlen (base);
  1405.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX") + 1);
  1406.     strcpy (temp_filename, base);
  1407. !   if (len > 0 && temp_filename[len-1] != '/')
  1408.       temp_filename[len++] = '/';
  1409.     strcpy (temp_filename + len, "ccXXXXXX");
  1410.   
  1411. --- 1451,1471 ----
  1412.     if (base == (char *)0)
  1413.       base = "./";
  1414.   
  1415. + #ifdef atarist
  1416. +   {
  1417. +       char *newbase = alloca(FILENAME_MAX);
  1418. +       dos2unx(base,newbase);
  1419. +       base = newbase;
  1420. +   }
  1421. + #endif
  1422.     len = strlen (base);
  1423.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX") + 1);
  1424.     strcpy (temp_filename, base);
  1425. !   if (len > 0 && (temp_filename[len-1] != '/' 
  1426. ! #ifdef atarist
  1427. !           || temp_filename[len-1] != '\\'
  1428. ! #endif
  1429. !            ))
  1430.       temp_filename[len++] = '/';
  1431.     strcpy (temp_filename + len, "ccXXXXXX");
  1432.   
  1433. ***************
  1434. *** 1427,1432 ****
  1435. --- 1484,1490 ----
  1436.      use come from an obstack, we don't have to worry about allocating
  1437.      space for them.  */
  1438.   
  1439. + #if (!(defined(CROSSATARI) || defined(atarist)))
  1440.   #ifndef HAVE_PUTENV
  1441.   
  1442.   void
  1443. ***************
  1444. *** 1528,1533 ****
  1445. --- 1586,1592 ----
  1446.     obstack_1grow (&collect_obstack, '\0');
  1447.     putenv (obstack_finish (&collect_obstack));
  1448.   }
  1449. + #endif /* ataris */
  1450.   
  1451.   
  1452.   /* Search for NAME using the prefix list PREFIXES.  MODE is passed to
  1453. ***************
  1454. *** 1812,1817 ****
  1455. --- 1871,1877 ----
  1456.   
  1457.   #else /* not __MSDOS__ */
  1458.   
  1459. + #ifndef atarist
  1460.   static int
  1461.   pexecute (search_flag, program, argv, not_last)
  1462.        int search_flag;
  1463. ***************
  1464. *** 1900,1905 ****
  1465. --- 1960,1966 ----
  1466.       }
  1467.   }
  1468.   
  1469. + #endif /* not atarist */
  1470.   #endif /* not __MSDOS__ */
  1471.   #else /* not OS2 */
  1472.   
  1473. ***************
  1474. *** 1930,1945 ****
  1475.       {
  1476.         char *prog;        /* program name.  */
  1477.         char **argv;        /* vector of args.  */
  1478.         int pid;            /* pid of process for this command.  */
  1479.       };
  1480.   
  1481.     struct command *commands;    /* each command buffer with above info.  */
  1482.   
  1483.     /* Count # of piped commands.  */
  1484.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1485.       if (strcmp (argbuf[i], "|") == 0)
  1486.         n_commands++;
  1487.     /* Get storage for each command.  */
  1488.     commands
  1489.       = (struct command *) alloca (n_commands * sizeof (struct command));
  1490. --- 1991,2011 ----
  1491.       {
  1492.         char *prog;        /* program name.  */
  1493.         char **argv;        /* vector of args.  */
  1494. + #ifndef atarist
  1495.         int pid;            /* pid of process for this command.  */
  1496. + #endif
  1497.       };
  1498.   
  1499.     struct command *commands;    /* each command buffer with above info.  */
  1500.   
  1501. + #ifndef atarist
  1502.     /* Count # of piped commands.  */
  1503.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1504.       if (strcmp (argbuf[i], "|") == 0)
  1505.         n_commands++;
  1506. ! #else
  1507. !   n_commands = 1;
  1508. ! #endif
  1509.     /* Get storage for each command.  */
  1510.     commands
  1511.       = (struct command *) alloca (n_commands * sizeof (struct command));
  1512. ***************
  1513. *** 1954,1959 ****
  1514. --- 2020,2026 ----
  1515.     if (string)
  1516.       commands[0].argv[0] = string;
  1517.   
  1518. + #ifndef atarist
  1519.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1520.       if (strcmp (argbuf[i], "|") == 0)
  1521.         {                /* each command.  */
  1522. ***************
  1523. *** 1968,1973 ****
  1524. --- 2035,2043 ----
  1525.         commands[n_commands].argv[0] = string;
  1526.       n_commands++;
  1527.         }
  1528. + #else
  1529. +   n_commands = 1;
  1530. + #endif
  1531.   
  1532.     argbuf[argbuf_index] = 0;
  1533.   
  1534. ***************
  1535. *** 1983,1991 ****
  1536. --- 2053,2063 ----
  1537.         for (j = commands[i].argv; *j; j++)
  1538.           fprintf (stderr, " %s", *j);
  1539.   
  1540. + #ifndef atarist
  1541.         /* Print a pipe symbol after all but the last command.  */
  1542.         if (i + 1 != n_commands)
  1543.           fprintf (stderr, " |");
  1544. + #endif
  1545.         fprintf (stderr, "\n");
  1546.       }
  1547.         fflush (stderr);
  1548. ***************
  1549. *** 2000,2016 ****
  1550. --- 2072,2098 ----
  1551.   #endif /* DEBUG */
  1552.       }
  1553.   
  1554. + #ifndef atarist
  1555.     /* Run each piped subprocess.  */
  1556.   
  1557.     last_pipe_input = STDIN_FILE_NO;
  1558.     for (i = 0; i < n_commands; i++)
  1559.       {
  1560. + #ifndef atariminix
  1561.         char *string = commands[i].argv[0];
  1562.   
  1563.         commands[i].pid = pexecute (string != commands[i].prog,
  1564.                     string, commands[i].argv,
  1565.                     i + 1 < n_commands);
  1566.   
  1567. + #else
  1568. +       extern int execv();
  1569. +       char *string = commands[i].argv[0];
  1570. +       commands[i].pid = pexecute (execv,
  1571. +                   string, commands[i].argv,
  1572. +                   i + 1 < n_commands);
  1573. + #endif
  1574.         if (string != commands[i].prog)
  1575.       free (string);
  1576.       }
  1577. ***************
  1578. *** 2057,2062 ****
  1579. --- 2139,2189 ----
  1580.         }
  1581.       return ret_code;
  1582.     }
  1583. + #else /* atarist */
  1584. +  {
  1585. +      register int iii;
  1586. +      int errfd, oldfd;
  1587. +      char **j;
  1588. +      execution_count++;
  1589. +      if (zflag)
  1590. +        {
  1591. +      errfd = Fopen("compile.err", 2);
  1592. +      if (errfd < __SMALLEST_VALID_HANDLE)
  1593. +        errfd = Fcreate("compile.err", 0);
  1594. +      else
  1595. +        Fseek(0L, errfd, 2);
  1596. +      if (errfd >= __SMALLEST_VALID_HANDLE)
  1597. +        {
  1598. +          oldfd = Fdup (2);
  1599. +          Fforce(2, errfd);
  1600. +        }
  1601. +      else
  1602. +        {
  1603. +          error("cannot open %s", "compile.err");
  1604. +          zflag = 0;        /* no redirection */
  1605. +        }
  1606. +        }
  1607. +      for (i = 0; i < n_commands ; i++)
  1608. +      {
  1609. +          j = commands[i].argv;
  1610. +          iii = spawnve(0, j[0], j, NULL);
  1611. +      if(iii != 0)
  1612. +          break;
  1613. +      }
  1614. +      if (zflag)
  1615. +        {
  1616. +      Fforce(2, oldfd);
  1617. +      Fclose(oldfd);
  1618. +      Fclose(errfd);
  1619. +        }
  1620. +      if (iii != 0)
  1621. +        return -1;
  1622. +      else
  1623. +        return 0;
  1624. +  }
  1625. + #endif /* atarist */  
  1626.   }
  1627.   
  1628.   /* Find all the switches given to us
  1629. ***************
  1630. *** 2120,2125 ****
  1631. --- 2247,2253 ----
  1632.   
  1633.     /* Set up the default search paths.  */
  1634.   
  1635. + #ifndef CROSSATARI
  1636.     if (gcc_exec_prefix)
  1637.       {
  1638.         add_prefix (&exec_prefix, gcc_exec_prefix, 0, 0, NULL_PTR);
  1639. ***************
  1640. *** 2194,2199 ****
  1641. --- 2322,2328 ----
  1642.           endp++;
  1643.       }
  1644.       }
  1645. + #endif /* CROSSATARI */
  1646.   
  1647.     /* Use LPATH like LIBRARY_PATH (for the CMU build program).  */
  1648.     temp = getenv ("LPATH");
  1649. ***************
  1650. *** 2402,2407 ****
  1651. --- 2531,2542 ----
  1652.             n_switches++;
  1653.             break;
  1654.           }
  1655. + #ifdef atarist
  1656. +         case 'z':    /* redirect stderr to a file */
  1657. +           zflag++;
  1658. +           n_switches++;
  1659. +           break;
  1660. + #endif
  1661.           default:
  1662.             n_switches++;
  1663.   
  1664. ***************
  1665. *** 2421,2431 ****
  1666. --- 2556,2577 ----
  1667.        (such as cpp) rather than those of the host system.  */
  1668.     /* Use 2 as fourth arg meaning try just the machine as a suffix,
  1669.        as well as trying the machine and the version.  */
  1670. + #if (defined(atarist) || defined(CROSSATARI) || defined(WEIRD))
  1671. + /* NB defined(WEIRD) should not really be there, its only for my weird setup */
  1672. +   /* We are not using machine_suffix here, so do not make */
  1673. +   /* these prefixes available only when we have one       */
  1674. +   add_prefix (&exec_prefix, standard_exec_prefix, 0, 0, NULL_PTR);
  1675. +   add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 0, NULL_PTR);
  1676. +   add_prefix (&startfile_prefix, standard_exec_prefix, 0, 0, NULL_PTR);
  1677. +   add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 0, NULL_PTR);
  1678. + #else
  1679.     add_prefix (&exec_prefix, standard_exec_prefix, 0, 2, NULL_PTR);
  1680.     add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 2, NULL_PTR);
  1681.   
  1682.     add_prefix (&startfile_prefix, standard_exec_prefix, 0, 1, NULL_PTR);
  1683.     add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 1, NULL_PTR);
  1684. + #endif /* (defined(atarist) || defined(CROSSATARI)) */
  1685.   
  1686.     tooldir_prefix = concat (tooldir_base_prefix, spec_machine, "/");
  1687.   
  1688. ***************
  1689. *** 2667,2674 ****
  1690. --- 2813,2822 ----
  1691.        If -pipe, this forces out the last command if it ended in `|'.  */
  1692.     if (value == 0)
  1693.       {
  1694. + #ifndef atarist
  1695.         if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
  1696.       argbuf_index--;
  1697. + #endif
  1698.   
  1699.         if (argbuf_index > 0)
  1700.       value = execute ();
  1701. ***************
  1702. *** 2706,2711 ****
  1703. --- 2854,2903 ----
  1704.          Otherwise, NL, SPC, TAB and % are special.  */
  1705.       switch (inswitch ? 'a' : c)
  1706.         {
  1707. + #if (defined(atarist) || defined(CROSSATARI))
  1708. + /* this stuff added by jrd.  if see '$', expect name of env var, delimited
  1709. +    by '$'.  Find it's value, and subst it in.
  1710. +    modified by ERS to only collect things that look like names; this
  1711. +    saves e.g. the -$ arg. to cpp from getting munged */
  1712. +       case '$':
  1713. +       {
  1714. +     char varname[32];        /* should be enough */
  1715. +     char * value;            /* deciphered value string */
  1716. +     char *temp;
  1717. +     int i;
  1718. +     extern char *getenv();
  1719. +     
  1720. +     for (i = 0 ; ((c = *p) != '$') && isalnum(c) && i < 31 ; i++, p++)
  1721. +         varname[i] = c;
  1722. +     varname[i] = '\0';
  1723. +     if (i > 0) /* ++jrb fix */
  1724. +     {
  1725. +                  ++p;    /* skip trailing '$' */
  1726. +         value = getenv(varname); /* ++jrb fix */
  1727. +         if (value)
  1728. +         { /* if value is a path, only consider 1'st component */
  1729. + #ifdef atarist
  1730. +             if((temp = index(value, ',')) == NULL)
  1731. +                 temp = index(value, ';');
  1732. + #else
  1733. +             temp = index(value, ':');
  1734. + #endif
  1735. +             obstack_grow (&obstack, value,
  1736. +                       temp ? temp - value : strlen (value));
  1737. +         }
  1738. +         else
  1739. +           obstack_1grow (&obstack, '.'); /* a complete kludge... */
  1740. +     }
  1741. +         else
  1742. +         {
  1743. +              obstack_1grow(&obstack, '$');
  1744. +         }
  1745. +     arg_going = 1;
  1746. +       }
  1747. +      break;
  1748. + #endif /* atarist */
  1749.         case '\n':
  1750.       /* End of line: finish any pending argument,
  1751.          then run the pending command if one has been started.  */
  1752. ***************
  1753. *** 3380,3392 ****
  1754. --- 3572,3592 ----
  1755.           break;
  1756.   
  1757.         default:
  1758. + #if 1 /* atarist */
  1759. +         fprintf(stderr, "Bogus char '%c' found at pos %d of spec '%s'\n",
  1760. +         c, (p - spec - 1), spec);
  1761. + #endif
  1762.           abort ();
  1763.         }
  1764.       break;
  1765.   
  1766. + #ifndef atarist
  1767. +       /* on the atari it is important to preserve backslash in spec */
  1768. +       /* so just let it go into default case */
  1769.         case '\\':
  1770.       /* Backslash: treat next character as ordinary.  */
  1771.       c = *p++;
  1772. + #endif
  1773.   
  1774.       /* fall through */
  1775.         default:
  1776. ***************
  1777. *** 3663,3668 ****
  1778. --- 3863,3869 ----
  1779.   
  1780.   /* On fatal signals, delete all the temporary files.  */
  1781.   
  1782. + #ifndef atarist
  1783.   static void
  1784.   fatal_error (signum)
  1785.        int signum;
  1786. ***************
  1787. *** 3674,3679 ****
  1788. --- 3875,3881 ----
  1789.        so its normal effect occurs.  */
  1790.     kill (getpid (), signum);
  1791.   }
  1792. + #endif
  1793.   
  1794.   int
  1795.   main (argc, argv)
  1796. ***************
  1797. *** 3688,3693 ****
  1798. --- 3890,3898 ----
  1799.     char *specs_file;
  1800.     char *p;
  1801.   
  1802. + #ifdef atarist
  1803. +   programname = "gcc";
  1804. + #else  
  1805.     p = argv[0] + strlen (argv[0]);
  1806.     while (p != argv[0] && p[-1] != '/') --p;
  1807.     programname = p;
  1808. ***************
  1809. *** 3704,3715 ****
  1810. --- 3909,3922 ----
  1811.     if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
  1812.       signal (SIGPIPE, fatal_error);
  1813.   #endif
  1814. + #endif /* atarist */
  1815.   
  1816.     argbuf_length = 10;
  1817.     argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
  1818.   
  1819.     obstack_init (&obstack);
  1820.   
  1821. + #if (!(defined(atarist) || defined(CROSSATARI)))
  1822.     /* Set up to remember the pathname of gcc and any options
  1823.        needed for collect.  We use argv[0] instead of programname because
  1824.        we need the complete pathname.  */
  1825. ***************
  1826. *** 3717,3722 ****
  1827. --- 3924,3930 ----
  1828.     obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=")-1);
  1829.     obstack_grow (&collect_obstack, argv[0], strlen (argv[0])+1);
  1830.     putenv (obstack_finish (&collect_obstack));
  1831. + #endif
  1832.   
  1833.     /* Choose directory for temp files.  */
  1834.   
  1835. ***************
  1836. *** 3728,3733 ****
  1837. --- 3936,3950 ----
  1838.   
  1839.     process_command (argc, argv);
  1840.   
  1841. + #if (defined(atarist) || defined(CROSSATARI))
  1842. +   {
  1843. +     char *temp;
  1844. +     
  1845. +     if((temp = getenv ("GCCEXEC")))
  1846. +     add_prefix (&exec_prefix, temp, 0, 0, 0);
  1847. +   }
  1848. + #endif
  1849. +   
  1850.     /* Initialize the vector of specs to just the default.
  1851.        This means one element containing 0s, as a terminator.  */
  1852.   
  1853. ***************
  1854. *** 3735,3740 ****
  1855. --- 3952,3961 ----
  1856.     bcopy (default_compilers, compilers, sizeof default_compilers);
  1857.     n_compilers = n_default_compilers;
  1858.   
  1859. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1860. +   specs_file = 0;
  1861. + #else
  1862.     /* Read specs from a file if there is one.  */
  1863.   
  1864.     machine_suffix = concat (spec_machine, "/", concat (spec_version, "/", ""));
  1865. ***************
  1866. *** 3744,3749 ****
  1867. --- 3965,3971 ----
  1868.     /* Read the specs file unless it is a default one.  */
  1869.     if (specs_file != 0 && strcmp (specs_file, "specs"))
  1870.       read_specs (specs_file);
  1871. + #endif
  1872.   
  1873.     /* If not cross-compiling, look for startfiles in the standard places.  */
  1874.     /* The fact that these are done here, after reading the specs file,
  1875. ***************
  1876. *** 3781,3787 ****
  1877.               0, 0, NULL_PTR);
  1878.         add_prefix (&startfile_prefix,
  1879.                 concat (standard_exec_prefix,
  1880. !                   machine_suffix,
  1881.                     standard_startfile_prefix),
  1882.                 0, 0, NULL_PTR);
  1883.       }               
  1884. --- 4003,4009 ----
  1885.               0, 0, NULL_PTR);
  1886.         add_prefix (&startfile_prefix,
  1887.                 concat (standard_exec_prefix,
  1888. !                   (machine_suffix)? machine_suffix : "",
  1889.                     standard_startfile_prefix),
  1890.                 0, 0, NULL_PTR);
  1891.       }               
  1892. ***************
  1893. *** 3816,3822 ****
  1894. --- 4038,4050 ----
  1895.   
  1896.     if (verbose_flag)
  1897.       {
  1898. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1899. + #include "PatchLev.h"
  1900. +       fprintf (stderr, "gcc-atariST version %s Patchlevel %s\n",
  1901. +            version_string, PatchLevel);
  1902. + #else
  1903.         fprintf (stderr, "gcc version %s\n", version_string);
  1904. + #endif
  1905.         if (n_infiles == 0)
  1906.       exit (0);
  1907.       }
  1908. ***************
  1909. *** 3864,3870 ****
  1910. --- 4092,4103 ----
  1911.   
  1912.         input_basename = input_filename;
  1913.         for (p = input_filename; *p; p++)
  1914. + #ifdef atarist
  1915. +         if (((*p == '/') || (*p == '\\')) && (*(p-1) != ':'))
  1916. +             /* allow both '\' and '/' with  our new lib */
  1917. + #else
  1918.           if (*p == '/')
  1919. + #endif
  1920.             input_basename = p + 1;
  1921.   
  1922.         /* Find a suffix starting with the last period,
  1923. ***************
  1924. *** 3927,3932 ****
  1925. --- 4160,4166 ----
  1926.         int i;
  1927.         int first_time;
  1928.   
  1929. + #if (!(defined(atarist) || defined(CROSSATARI)))
  1930.         /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
  1931.        for collect.  */
  1932.         putenv_from_prefixes (&exec_prefix, "COMPILER_PATH=");
  1933. ***************
  1934. *** 3957,3962 ****
  1935. --- 4191,4197 ----
  1936.       }
  1937.         obstack_grow (&collect_obstack, "\0", 1);
  1938.         putenv (obstack_finish (&collect_obstack));
  1939. + #endif
  1940.   
  1941.         value = do_spec (link_command_spec);
  1942.         if (value < 0)
  1943. *** gcc-2.5.0/getpwd.c    Tue Sep 21 17:35:41 1993
  1944. --- /usr1/bammi/sun/usr2/gcc/getpwd.c    Fri May 21 08:35:37 1993
  1945. ***************
  1946. *** 14,20 ****
  1947.      BSD systems) now provides getcwd as called for by POSIX.  Allow for
  1948.      the few exceptions to the general rule here.  */
  1949.   
  1950. ! #if !(defined (POSIX) || defined (USG) || defined (VMS))
  1951.   #include <sys/param.h>
  1952.   extern char *getwd ();
  1953.   #define getcwd(buf,len) getwd(buf)
  1954. --- 14,20 ----
  1955.      BSD systems) now provides getcwd as called for by POSIX.  Allow for
  1956.      the few exceptions to the general rule here.  */
  1957.   
  1958. ! #if !(defined (POSIX) || defined (USG) || defined (VMS) || defined(atarist) || defined(CROSSHPUX))
  1959.   #include <sys/param.h>
  1960.   extern char *getwd ();
  1961.   #define getcwd(buf,len) getwd(buf)
  1962. ***************
  1963. *** 48,58 ****
  1964.     if (!p && !(errno = failure_errno))
  1965.       {
  1966.         if (! ((p = getenv ("PWD")) != 0
  1967.            && *p == '/'
  1968.            && stat (p, &pwdstat) == 0
  1969.            && stat (".", &dotstat) == 0
  1970.            && dotstat.st_ino == pwdstat.st_ino
  1971. !          && dotstat.st_dev == pwdstat.st_dev))
  1972.   
  1973.       /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
  1974.       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
  1975. --- 48,61 ----
  1976.     if (!p && !(errno = failure_errno))
  1977.       {
  1978.         if (! ((p = getenv ("PWD")) != 0
  1979. + #ifndef atarist
  1980.            && *p == '/'
  1981.            && stat (p, &pwdstat) == 0
  1982.            && stat (".", &dotstat) == 0
  1983.            && dotstat.st_ino == pwdstat.st_ino
  1984. !          && dotstat.st_dev == pwdstat.st_dev
  1985. ! #endif
  1986. !          ))
  1987.   
  1988.       /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
  1989.       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
  1990. *** gcc-2.5.0/toplev.c    Tue Dec 14 10:45:57 1993
  1991. --- /usr1/bammi/sun/usr2/gcc/toplev.c    Tue Dec 14 10:38:08 1993
  1992. ***************
  1993. *** 31,37 ****
  1994.   
  1995.   #include <sys/stat.h>
  1996.   
  1997. ! #ifdef USG
  1998.   #undef FLOAT
  1999.   #include <sys/param.h>
  2000.   /* This is for hpux.  It is a real screw.  They should change hpux.  */
  2001. --- 31,37 ----
  2002.   
  2003.   #include <sys/stat.h>
  2004.   
  2005. ! #if defined(USG) || defined(CROSSHPUX)
  2006.   #undef FLOAT
  2007.   #include <sys/param.h>
  2008.   /* This is for hpux.  It is a real screw.  They should change hpux.  */
  2009. ***************
  2010. *** 41,49 ****
  2011. --- 41,57 ----
  2012.   #undef FFS  /* Some systems define this in param.h.  */
  2013.   #else
  2014.   #ifndef VMS
  2015. + #if (!(defined(atarist) || defined(atariminix)))
  2016.   #include <sys/time.h>
  2017.   #include <sys/resource.h>
  2018. + #endif /* !(atarist || atariminix) */
  2019. + #endif
  2020.   #endif
  2021. + #ifdef atariminix
  2022. + #include <sys/times.h>
  2023. + /* #include <minix/const.h>, avoid dragging this in */
  2024. + #define HZ 60    /* this is the only thing needed from minix/const.h */
  2025.   #endif
  2026.   
  2027.   #include "input.h"
  2028. ***************
  2029. *** 61,66 ****
  2030. --- 69,79 ----
  2031.   #include "bytecode.h"
  2032.   #include "bc-emit.h"
  2033.   
  2034. + #ifdef atarist
  2035. + long _stksize = -1L;    /* for all sizes of ST's */
  2036. +     /* -1 means malloc from own heap and keep all  of memory */
  2037. + #endif /* atarist */
  2038.   #ifdef VMS
  2039.   /* The extra parameters substantially improve the I/O performance.  */
  2040.   static FILE *
  2041. ***************
  2042. *** 792,798 ****
  2043.   int
  2044.   get_run_time ()
  2045.   {
  2046. ! #ifdef USG
  2047.     struct tms tms;
  2048.   #else
  2049.   #ifndef VMS
  2050. --- 805,814 ----
  2051.   int
  2052.   get_run_time ()
  2053.   {
  2054. ! #ifdef atarist
  2055. !   long now;
  2056. ! #else
  2057. ! #if (defined(USG) || defined(atariminix) || defined(CROSSHPUX))
  2058.     struct tms tms;
  2059.   #else
  2060.   #ifndef VMS
  2061. ***************
  2062. *** 807,817 ****
  2063.       } vms_times;
  2064.   #endif
  2065.   #endif
  2066.   
  2067.     if (quiet_flag)
  2068.       return 0;
  2069.   
  2070. ! #ifdef USG
  2071.     times (&tms);
  2072.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  2073.   #else
  2074. --- 823,837 ----
  2075.       } vms_times;
  2076.   #endif
  2077.   #endif
  2078. + #endif
  2079.   
  2080.     if (quiet_flag)
  2081.       return 0;
  2082.   
  2083. ! #ifdef atarist
  2084. !   return(time(NULL) * 1000000);
  2085. ! #else
  2086. ! #if (defined(USG) || defined(atariminix) || defined(CROSSHPUX))
  2087.     times (&tms);
  2088.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  2089.   #else
  2090. ***************
  2091. *** 824,829 ****
  2092. --- 844,850 ----
  2093.     return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
  2094.   #endif
  2095.   #endif
  2096. + #endif
  2097.   }
  2098.   
  2099.   #define TIMEVAR(VAR, BODY)    \
  2100. ***************
  2101. *** 1461,1466 ****
  2102. --- 1482,1488 ----
  2103.     longjmp (float_handler, 1);
  2104.   }
  2105.   
  2106. + #ifndef atarist
  2107.   /* Handler for SIGPIPE.  */
  2108.   
  2109.   static void
  2110. ***************
  2111. *** 1470,1475 ****
  2112. --- 1492,1498 ----
  2113.   {
  2114.     fatal ("output pipe has been closed");
  2115.   }
  2116. + #endif
  2117.   
  2118.   /* Strip off a legitimate source ending from the input string NAME of
  2119.      length LEN. */
  2120. ***************
  2121. *** 1523,1528 ****
  2122. --- 1546,1552 ----
  2123.     putc ('\"', asm_file);
  2124.   }
  2125.   
  2126. + #ifdef SYSV
  2127.   /* Output a file name in the form wanted by System V.  */
  2128.   
  2129.   void
  2130. ***************
  2131. *** 1553,1558 ****
  2132. --- 1577,1583 ----
  2133.   #endif
  2134.   #endif
  2135.   }
  2136. + #endif
  2137.   
  2138.   /* Routine to build language identifier for object file. */
  2139.   static void
  2140. ***************
  2141. *** 1665,1671 ****
  2142. --- 1690,1700 ----
  2143.       {
  2144.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2145.         strcpy (dumpname, dump_base_name);
  2146. + #ifndef atarist
  2147.         strcat (dumpname, ".jump");
  2148. + #else
  2149. +       strcat (dumpname, ".jmp");
  2150. + #endif
  2151.         jump_opt_dump_file = fopen (dumpname, "w");
  2152.         if (jump_opt_dump_file == 0)
  2153.       pfatal_with_name (dumpname);
  2154. ***************
  2155. *** 1687,1693 ****
  2156. --- 1716,1726 ----
  2157.       {
  2158.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2159.         strcpy (dumpname, dump_base_name);
  2160. + #ifndef atarist
  2161.         strcat (dumpname, ".loop");
  2162. + #else
  2163. +       strcat (dumpname, ".lop");
  2164. + #endif
  2165.         loop_dump_file = fopen (dumpname, "w");
  2166.         if (loop_dump_file == 0)
  2167.       pfatal_with_name (dumpname);
  2168. ***************
  2169. *** 1698,1704 ****
  2170. --- 1731,1741 ----
  2171.       {
  2172.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2173.         strcpy (dumpname, dump_base_name);
  2174. + #ifndef atarist
  2175.         strcat (dumpname, ".cse2");
  2176. + #else
  2177. +       strcat (dumpname, ".cs2");
  2178. + #endif
  2179.         cse2_dump_file = fopen (dumpname, "w");
  2180.         if (cse2_dump_file == 0)
  2181.       pfatal_with_name (dumpname);
  2182. ***************
  2183. *** 1709,1715 ****
  2184. --- 1746,1756 ----
  2185.       {
  2186.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2187.         strcpy (dumpname, dump_base_name);
  2188. + #ifndef atarist
  2189.         strcat (dumpname, ".flow");
  2190. + #else
  2191. +       strcat (dumpname, ".flo");
  2192. + #endif
  2193.         flow_dump_file = fopen (dumpname, "w");
  2194.         if (flow_dump_file == 0)
  2195.       pfatal_with_name (dumpname);
  2196. ***************
  2197. *** 1720,1726 ****
  2198. --- 1761,1771 ----
  2199.       {
  2200.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 10);
  2201.         strcpy (dumpname, dump_base_name);
  2202. + #ifndef atarist
  2203.         strcat (dumpname, ".combine");
  2204. + #else
  2205. +       strcat (dumpname, ".cmb");
  2206. + #endif
  2207.         combine_dump_file = fopen (dumpname, "w");
  2208.         if (combine_dump_file == 0)
  2209.       pfatal_with_name (dumpname);
  2210. ***************
  2211. *** 1731,1737 ****
  2212. --- 1776,1786 ----
  2213.       {
  2214.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 7);
  2215.         strcpy (dumpname, dump_base_name);
  2216. + #ifndef atarist
  2217.         strcat (dumpname, ".sched");
  2218. + #else
  2219. +       strcat (dumpname, ".sch");
  2220. + #endif
  2221.         sched_dump_file = fopen (dumpname, "w");
  2222.         if (sched_dump_file == 0)
  2223.       pfatal_with_name (dumpname);
  2224. ***************
  2225. *** 1742,1748 ****
  2226. --- 1791,1801 ----
  2227.       {
  2228.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2229.         strcpy (dumpname, dump_base_name);
  2230. + #ifndef atarist
  2231.         strcat (dumpname, ".lreg");
  2232. + #else
  2233. +       strcat (dumpname, ".lrg");
  2234. + #endif
  2235.         local_reg_dump_file = fopen (dumpname, "w");
  2236.         if (local_reg_dump_file == 0)
  2237.       pfatal_with_name (dumpname);
  2238. ***************
  2239. *** 1753,1759 ****
  2240. --- 1806,1816 ----
  2241.       {
  2242.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2243.         strcpy (dumpname, dump_base_name);
  2244. + #ifndef atarist
  2245.         strcat (dumpname, ".greg");
  2246. + #else
  2247. +       strcat (dumpname, ".grg");
  2248. + #endif
  2249.         global_reg_dump_file = fopen (dumpname, "w");
  2250.         if (global_reg_dump_file == 0)
  2251.       pfatal_with_name (dumpname);
  2252. ***************
  2253. *** 1764,1770 ****
  2254. --- 1821,1831 ----
  2255.       {
  2256.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 8);
  2257.         strcpy (dumpname, dump_base_name);
  2258. + #ifndef atarist
  2259.         strcat (dumpname, ".sched2");
  2260. + #else
  2261. +       strcat (dumpname, ".sc2");
  2262. + #endif
  2263.         sched2_dump_file = fopen (dumpname, "w");
  2264.         if (sched2_dump_file == 0)
  2265.       pfatal_with_name (dumpname);
  2266. ***************
  2267. *** 1775,1781 ****
  2268. --- 1836,1846 ----
  2269.       {
  2270.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 7);
  2271.         strcpy (dumpname, dump_base_name);
  2272. + #ifndef atarist
  2273.         strcat (dumpname, ".jump2");
  2274. + #else
  2275. +       strcat (dumpname, ".jp2");
  2276. + #endif
  2277.         jump2_opt_dump_file = fopen (dumpname, "w");
  2278.         if (jump2_opt_dump_file == 0)
  2279.       pfatal_with_name (dumpname);
  2280. ***************
  2281. *** 1799,1805 ****
  2282. --- 1864,1874 ----
  2283.       {
  2284.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 10);
  2285.         strcpy (dumpname, dump_base_name);
  2286. + #ifndef atarist
  2287.         strcat (dumpname, ".stack");
  2288. + #else
  2289. +       strcat (dumpname, ".stk");
  2290. + #endif
  2291.         stack_reg_dump_file = fopen (dumpname, "w");
  2292.         if (stack_reg_dump_file == 0)
  2293.       pfatal_with_name (dumpname);
  2294. ***************
  2295. *** 2931,2937 ****
  2296. --- 3000,3011 ----
  2297.     save_argv = argv;
  2298.   
  2299.     p = argv[0] + strlen (argv[0]);
  2300. + #ifndef atarist
  2301.     while (p != argv[0] && p[-1] != '/') --p;
  2302. + #else
  2303. +   while (p != argv[0] && ((p[-1] != '/') && (p[-1] != '\\') &&
  2304. +               (p[-1] != ':'))) --p;
  2305. + #endif
  2306.     progname = p;
  2307.   
  2308.   #ifdef RLIMIT_STACK
  2309. ***************
  2310. *** 2948,2956 ****
  2311. --- 3022,3032 ----
  2312.   
  2313.     signal (SIGFPE, float_signal);
  2314.   
  2315. + #ifndef atarist
  2316.   #ifdef SIGPIPE
  2317.     signal (SIGPIPE, pipe_closed);
  2318.   #endif
  2319. + #endif
  2320.   
  2321.     decl_printable_name = decl_name;
  2322.     lang_expand_expr = (struct rtx_def *(*)()) do_abort;
  2323. ***************
  2324. *** 3049,3054 ****
  2325. --- 3125,3142 ----
  2326.         else if (!strcmp (str, "dumpbase"))
  2327.           {
  2328.             dump_base_name = argv[++i];
  2329. + #ifdef atarist
  2330. +           /* dump_base_name will typically be 'foo.c' here.
  2331. +              Need to truncate at the '.', cause dots mean 
  2332. +              something here
  2333. +            */
  2334. +               {
  2335. +               char * n = dump_base_name;
  2336. +           for ( ; ((*n) && (*n != '.')) ; )
  2337. +                       n++;
  2338. +                   *n = '\0';
  2339. +           }
  2340. + #endif
  2341.           }
  2342.         else if (str[0] == 'd')
  2343.           {
  2344. ***************
  2345. *** 3480,3486 ****
  2346. --- 3568,3580 ----
  2347.        option flags in use.  */
  2348.     if (version_flag)
  2349.       {
  2350. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  2351. + #include "PatchLev.h"
  2352. +         fprintf (stderr, "%s version %s-atariST Patchlevel %s",
  2353. +          language_string, version_string, PatchLevel);
  2354. + #else
  2355.         fprintf (stderr, "%s version %s", language_string, version_string);
  2356. + #endif
  2357.   #ifdef TARGET_VERSION
  2358.         TARGET_VERSION;
  2359.   #endif
  2360. ***************
  2361. *** 3505,3510 ****
  2362. --- 3599,3606 ----
  2363.     if (output_bytecode)
  2364.       bc_write_file (stdout);
  2365.   
  2366. + #if (!(defined(atarist) || defined(atariminix)))
  2367. + #if (!(defined(CROSSHPUX)))
  2368.   #ifndef OS2
  2369.   #ifndef VMS
  2370.     if (flag_print_mem)
  2371. ***************
  2372. *** 3523,3528 ****
  2373. --- 3619,3626 ----
  2374.       }
  2375.   #endif /* not VMS */
  2376.   #endif /* not OS2 */
  2377. + #endif
  2378. + #endif
  2379.   
  2380.     if (errorcount)
  2381.       exit (FATAL_EXIT_CODE);
  2382. ***************
  2383. *** 3634,3636 ****
  2384. --- 3732,3753 ----
  2385.   
  2386.     fprintf (stderr, "\n");
  2387.   }
  2388. + #ifdef atarist
  2389. + #include <string.h>
  2390. + char *atari_filename_nondirectory(p)
  2391. + char *p;
  2392. + {
  2393. +     char *s;
  2394. +     
  2395. +     for(s = p + strlen(p); s != p; --s)
  2396. +     {
  2397. +     if((*s == '/') || (*s == '\\'))
  2398. +         break;
  2399. +     }
  2400. +     
  2401. +     return (s == p) ? p : s+1;
  2402. + }
  2403. + #endif
  2404. *** gcc-2.5.0/varasm.c    Thu Jan 27 15:20:36 1994
  2405. --- /usr1/bammi/sun/usr2/gcc/varasm.c    Thu Jan 27 15:22:01 1994
  2406. ***************
  2407. *** 2831,2836 ****
  2408. --- 2831,2839 ----
  2409.   {
  2410.     struct rtx_const val0, val1;
  2411.   
  2412. +   if (XEXP (x, 0) == pc_rtx || XEXP (x, 1) == pc_rtx)
  2413. +     return XEXP (x, 0) == XEXP (x, 1) ? const0_rtx : x;
  2414.     decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0);
  2415.     decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1);
  2416.   
  2417.